<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //   对象数据类型传参;
      var arr = [1, 2, 3];
      function fn(arr) {
        for (var i = 0; i < arr.length; i++) {
          arr[i] += 2;
        }
      }
      fn(arr);
      console.log(arr);
    </script>
  </body>
</html>
